// +----------------------------------------------------------------------
// | 用户中心api请求
// +----------------------------------------------------------------------

import request from "@/utils/request.js";

/**
 * 举例get请求
 * 获取用户信息
 * @param int id
 * 
 */
export function getUserInfo(id) {
	return request.get('users/usersInfo?users_id=' + id, {}, {});
}

/**
 * 获取关于我们下一个页面内容
 * 
 */
export function getAgreementNextContent(name) {
	return request.get('users/config/agreement?key=' + name, {}, {});
}

/******************* 个人认证 ***************************/

/**
 * 获取个人认证信息
 * @param int id
 * 
 */
export function getPersonInfo(id) {
	return request.get('users/personInfo?users_id=' + id, {}, {});
}

/**
 * post请求
 * 提交个人信息
 * @param data object
 */
export function addPerson(data) {
	return request.post("users/personAdd", data, {});
}


/******************* 企业认证 ***************************/

/**
 * 获取职位信息
 * @param int id
 * 
 */
export function getPosition() {
	return request.get('users/position', {}, {});
}

/**
 * get请求
 * 获取公司信息
 * @param int id
 * 
 */
export function getCompanyInfo(id) {
	return request.get('users/companyInfo?users_id=' + id, {}, {});
}

/**
 * get请求
 * 获取员工信息
 * @param int id
 * 
 */

export function getCompanyStaffInfo(id) {
	return request.get('users/companyStaffInfo?id=' + id, {}, {});
}

/**
 * post请求
 * 认证信息提交
 * @param data object
 */
export function addCompany(data) {
	return request.post("users/companyAdd", data, {});
}

/**
 * post请求
 * 员工信息提交
 * @param data object
 */
export function addCompanyStaff(data) {
	return request.post("users/companyStaffAdd", data, {});
}


/**
 * memberList 会员卡列表
 */

export function getMemberList() {
	return request.get("users/memberList", {
		noAuth: true
	});
}
/**
 * 用户头像上传

 * @param {Object} userId
 * @param {Object} imgUrl
 */
export function uploadUserImg(userId, imgUrl) {
	return request.post("users/imageurlUpdate", {
		users_id: userId,
		imageurl: imgUrl
	}, {});
}
/**
 * 用户简介更新
 * @param {Object} userId
 * @param {Object} biref
 */
export function updateBrief(userId, biref) {
	return request.post("users/briefUpdate", {
		users_id: userId,
		brief: biref
	}, {});
}
/**
 * 城市更新

 * @param {Object} userId
 * @param {Object} biref
 */
export function updateCity(userId, city) {
	return request.post("users/cityUpdate", {
		users_id: userId,
		city: city
	}, {});
}
/**
 * 数据统计报表
 * @param {Object} id
 */
export function getDataStatistic(id) {
	return request.get("users/usersDataStatistics?users_id=" + id, {
		noAuth: true
	});
}
/**
 * 数据统计列表
 * @param {Object} id
 */
export function getDataStatisticList(id,state,timeState,pageNum,page) {
	return request.get(`users/usersDataStatisticsList?users_id=${id}&state=${state}&time_state=${timeState}&page_num=${pageNum}&page=${page}`, {
		noAuth: true
	});
}
/**
 * 数据分组
 * @param {Object} id
 * @param {Object} state
 */
export function getDataStatisticGroud(id,state) {
	return request.get(`users/usersDataStatisticsGrouping?users_id=${id}&state=${state}`, {
		noAuth: true
	});
}
export function uploadPicture(data){
	return request.post("common/uploadPicturesBase64", {
		picture: data,
	}, {});
}
/**
 * 删除员工

 * @param {Object} id
 */
export function deleteEmployerr (id){
	return request.post("users/companyStaffDelete", {
		id: id,
	}, {});
}

/**
 * 关注的人
 * @param {Object} users_id
 */
export function peopleFollow(users_id,pageNum,page) {
	return request.get(`users/peopleFollow?users_id=${users_id}&page_num=${pageNum}&page=${page}`);
}

/**
 * 关注的人
 * @param {Object} users_id
 */
export function peopleCarsSources(users_id,vehicle_model_id,pageNum,page) {
	return request.get(`users/peopleCarsSources?users_id=${users_id}&vehicle_model_id=${vehicle_model_id}&page_num=${pageNum}&page=${page}`);
}